package com.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author edehhjn
 * 普通url请求
 */
@Controller
public class GurlController {
	
	/**
	 * 会查找指定模板
	 * @return
	 */
	@RequestMapping("/ghello")
	public String ghello() {
		return "index";
	}
	
	/**
	 * 返回json字符串
	 * 如果是@Controller就需要@ResponseBody
	 * 如果是@RestController则不需要
	 * @return
	 */
	@RequestMapping("/gjson")
	@ResponseBody
	public String gjson() {
		return "index.html";
	}
}
